home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 11 January 2002
- //
- // Procedure Name:
- // buildConvertMM
- //
- // Description:
- // This procedure creates the popup/marking menu
- // for surface component conversion (ctrl RMB)
- // that gets attached to the main view panes.
- // This menu builds dynamically, and changes its
- // contents based on what item the mouse is clicked
- // over.
- //
- // Input Arguments:
- // The parent item to parent the popup menu to.
- //
- // Return Value:
- // None.
-
-
- global proc buildConvertMM(string $parent)
- {
- // first determine the lead object (last selected object)
- string $leadObject[] = `ls -selection -tail 1`;
- string $shape[];
- if (0 < size($leadObject)){
-
- // user must have something selected
- // generally it's components
- $shape = `listRelatives -parent -shapes $leadObject[0]`;
-
- // but it may be objects
- if (size($shape) < 1) {
- $shape = `listRelatives -children -shapes $leadObject[0]`;
- }
- } else {
- $shape[0] = "";
- }
-
- // build the appropriate conversion marking menu
- string $nodeType;
- if( $shape[0] != "") {
- $nodeType = `nodeType $shape[0]`;
- if ($nodeType == "mesh" ||
- $nodeType == "nurbsSurface" ||
- $nodeType == "subdiv")
- {
- $nodeType = $nodeType;
- } else {
- $nodeType = "noConversion";
- }
-
- // if there is no appropriate conversion marking menu
- // build the windows marking menu
- } else {
- $nodeType = "noConversion";
- }
-
- switch( $nodeType ) {
- case "mesh":
- polyConvertMM( $parent );
- break;
- case "nurbsSurface":
- nurbsConvertMM( $parent );
- break;
- case "subdiv":
- subdConvertMM( $parent );
- break;
- case "noConversion":
- buildObjectMenuItemsNow( $parent );
- break;
- default:
- break;
- }
-
- }